<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>播放动画</title>
    <script src="../EaselJS/lib/easeljs-0.8.2.min.js"></script>
</head>
<body onload="init();">
<canvas id="demoCanvas" width="800" height="300"></canvas>
<script type="text/javascript">
    var canvas = document.getElementById("demoCanvas");
    var stage = new createjs.Stage(canvas);
    createjs.Ticker.setFPS(24);
    function setup() {
        var spritesheet = new createjs.SpriteSheet({
            "images": ['img/stay.png'],
            "frames": {"height": 93, "count": 15, "width": 60},
            "animations": { run: [0,15]}
        });
        var character = new createjs.Sprite(spritesheet, "run");
        character.framerate = 10;
        character.play();//播放动画
        stage.addChild(character);
        createjs.Ticker.addEventListener("tick", tick);
    }
    function tick(event) {
        stage.update();
    }
    function init() {
        setup();
    }
</script>
</body>
</html>